

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/blog/img/favicon.jpg">
  <link rel="icon" href="/blog/img/favicon.jpg">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="_SayUw">
  <meta name="keywords" content="html css js">
  
    <meta name="description" content="事前准备  Node.js  Git  Gitee 账号     PS：Gitee 账号需要进行实名认证，才可以使用 Gitee Pages 服务    安装 Hexo 使用 npm 全局安装 Hexo-Cli 1$ npm install -g hexo-cli   安装完脚手架后，选择自己想要放置项目的目录，初始化 Hexo 123$ hexo init &lt;folder&gt;$ cd">
<meta property="og:type" content="article">
<meta property="og:title" content="【应用 | Hexo】Gitee Page + Hexo 部署个人博客">
<meta property="og:url" content="https://sayuw.gitee.io/blog/2022/08/24/helloHexo/index.html">
<meta property="og:site_name" content="SayUw&#39;s Blog">
<meta property="og:description" content="事前准备  Node.js  Git  Gitee 账号     PS：Gitee 账号需要进行实名认证，才可以使用 Gitee Pages 服务    安装 Hexo 使用 npm 全局安装 Hexo-Cli 1$ npm install -g hexo-cli   安装完脚手架后，选择自己想要放置项目的目录，初始化 Hexo 123$ hexo init &lt;folder&gt;$ cd">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://sayuw.gitee.io/blog/2022/08/24/helloHexo/2022-08-24-12-44-22-image.png">
<meta property="og:image" content="https://sayuw.gitee.io/blog/2022/08/24/helloHexo/2022-08-24-13-16-29-image.png">
<meta property="og:image" content="https://sayuw.gitee.io/blog/2022/08/24/helloHexo/2022-08-24-13-22-45-image.png">
<meta property="article:published_time" content="2022-08-24T05:48:36.000Z">
<meta property="article:modified_time" content="2023-03-24T01:47:18.637Z">
<meta property="article:author" content="_SayUw">
<meta property="article:tag" content="git">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://sayuw.gitee.io/blog/2022/08/24/helloHexo/2022-08-24-12-44-22-image.png">
  
  
  
  <title>【应用 | Hexo】Gitee Page + Hexo 部署个人博客 - SayUw&#39;s Blog</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/blog/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/blog/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/blog/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"sayuw.gitee.io","root":"/blog/","version":"1.9.2","typing":{"enable":true,"typeSpeed":60,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":3},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/blog/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/blog/js/utils.js" ></script>
  <script  src="/blog/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/blog/">
      <strong>_SayUw</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/blog/img/post.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="【应用 | Hexo】Gitee Page + Hexo 部署个人博客"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-08-24 13:48" pubdate>
          2022年8月24日 下午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.3k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          20 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">【应用 | Hexo】Gitee Page + Hexo 部署个人博客</h1>
            
            
              <div class="markdown-body">
                
                <h2 id="事前准备"><a href="# 事前准备" class="headerlink" title="事前准备"></a > 事前准备 </h2><ul>
<li><p>Node.js</p>
</li>
<li><p>Git</p>
</li>
<li><p>Gitee 账号 </p>
</li>
</ul>
<blockquote>
<p>PS：Gitee 账号需要进行实名认证，才可以使用 Gitee Pages 服务 </p>
</blockquote>
<h2 id="安装 Hexo"><a href="# 安装 Hexo" class="headerlink" title="安装 Hexo"></a > 安装 Hexo</h2><p > 使用 npm 全局安装 Hexo-Cli</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ npm install -g hexo-cli<br></code></pre></td></tr></table></figure>

<p > 安装完脚手架后，选择自己想要放置项目的目录，初始化 Hexo</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo init &lt;folder&gt;<br>$ <span class="hljs-built_in">cd</span> &lt;folder&gt;<br>$ npm install<br></code></pre></td></tr></table></figure>

<p > 生成的项目结构如下所示 </p>
<p><img src="/blog/2022/08/24/helloHexo/2022-08-24-12-44-22-image.png" srcset="/blog/img/loading.gif" lazyload></p>
<ul>
<li><p>scaffolds：模板文件 </p>
</li>
<li><p>source：静态资源，博客 MD 文件 </p>
</li>
<li><p>themes：主题文件 </p>
</li>
<li><p>_config.yml：配置文件 </p>
</li>
<li><p>_config.XXXX.yml：对应主题的配置文件 </p>
</li>
</ul>
<h2 id="本地部署运行 Hexo"><a href="# 本地部署运行 Hexo" class="headerlink" title="本地部署运行 Hexo"></a > 本地部署运行 Hexo</h2><p > 生成的 Hexo 项目中自带了 landscape 主题，并且附带了一篇 helloWorld 的博客，我们可以直接尝试生成静态页面，并在本地运行 </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo clean   <span class="hljs-comment"># 清除缓存文件（db.json）和生成的静态文件（public）</span><br>$ hexo g /hexo generate   <span class="hljs-comment"># 根据主题和 MD 文件生成静态文件 </span><br>$ hexo s /hexo server   <span class="hljs-comment"># 启动本地服务器，默认为 http://localhost:4000/</span><br></code></pre></td></tr></table></figure>

<p > 运行指令后，访问 localhost:4000 就可以预览博客啦！</p>
<p><img src="/blog/2022/08/24/helloHexo/2022-08-24-13-16-29-image.png" srcset="/blog/img/loading.gif" lazyload></p>
<h2 id="创建 Gitee 开源仓库"><a href="# 创建 Gitee 开源仓库" class="headerlink" title="创建 Gitee 开源仓库"></a > 创建 Gitee 开源仓库 </h2><p > 创建对应的仓库，并在服务中切换为 Gitee Pages</p>
<p><img src="/blog/2022/08/24/helloHexo/2022-08-24-13-22-45-image.png" srcset="/blog/img/loading.gif" lazyload></p>
<blockquote>
<p>PS：注意网站地址，这里是二级目录，所以需要修改 Hexo 的 <code>_config.yml</code> 里的配置，不然部署时会出现静态资源加载失败的问题。</p>
<p > 以该网址为例，将网站的 url 改为 <code>https://sayuw.gitee.io/blog</code> ，并将 root 改为 <code>/blog/</code> ，具体可以参考下一章节。</p>
</blockquote>
<h2 id="配置 Git 自动部署"><a href="# 配置 Git 自动部署" class="headerlink" title="配置 Git 自动部署"></a > 配置 Git 自动部署 </h2><p > 安装自动部署发布插件 </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ npm install hexo-deployer-git<br></code></pre></td></tr></table></figure>

<p > 安装完成后，修改 <code>_config.yml</code> 配置为我们要发布的仓库 </p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">deploy:</span><br>  <span class="hljs-attr">type:</span> <span class="hljs-string">git</span><br>  <span class="hljs-attr">repo:</span> <span class="hljs-string">https://gitee.com/sayuw/blog.git</span><br>  <span class="hljs-attr">branch:</span> <span class="hljs-string">master</span><br></code></pre></td></tr></table></figure>

<p > 并将 url 和 root 修改为 Gitee Pages 对应的网址 </p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">url:</span> <span class="hljs-string">https://sayuw.gitee.io/blog/</span><br><span class="hljs-attr">root:</span> <span class="hljs-string">/blog/</span><br></code></pre></td></tr></table></figure>

<p > 部署到 Gitee</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo clean<br>$ hexo g /hexo generate<br>$ hexo d /hexo deploy   <span class="hljs-comment"># 将生成的静态页面推送到配置的仓库 </span><br></code></pre></td></tr></table></figure>

<p > 推送完成后，在 Gitee Pages 服务页面中点击更新即可浏览最新的页面 </p>
<h2 id="其他插件"><a href="# 其他插件" class="headerlink" title="其他插件"></a > 其他插件 </h2><ul>
<li><p > 本站使用的主题为 Fluid，感谢 Fluid 团队提供了简洁又具有丰富配置的主题。</p>
</li>
<li><p > 为了阅读性，需要在英文与中文间添加空格。参照 Hexo 官网的配置，在 <code>_config.yml</code> 中添加了 <code>auto_spacing: true</code> 的配置，实际使用中发现并不生效。所以安装了对应的插件 <code>hexo-auto-spacing</code> 。</p>
<blockquote>
<p>PS：这个插件有点坑，在我使用行内代码块的时候，它将 &lt;code&gt; 这个标签也给分开了，变成了 &lt; code&gt; ，导致页面的渲染出了问题。<br > 我看了一下源码，发现它是在 pangu 这个插件的基础上封装了一层，调用的 pangu 的 api： <code>data.content = pangu.spacing (data.content);</code> ，将生成的 html 的内容塞进去加入空格。修改无果，只能手动在行内代码块的左右两边加上空格（加粗、斜体啥的也有这个问题），解决这个问题。</p>
<p>PPS：这个插件的作者还挺有意思的，点开页面几个大字：為什麼你們就是不能加個空格呢？<br > 有点戳中笑点了哈哈哈哈哈哈哈哈哈哈！</p>
</blockquote>
</li>
<li><p > 为了方便保存图片，将 <code>_config.yml</code> 中的 <code>post_asset_folder</code> 改为 <code>true</code> ，并安装了 <code>hexo-asset-image</code> ，在生成文章时会生成同名的文件夹，可以将图片保存在当中并引用。</p>
<blockquote>
<p>PS：这个插件有点问题，下载的 npm 包不是最新的代码。如果网站以.io 结尾的话，生成的图片的 URL 会变成 <code>/.io/xxx.jpg</code> 。可以从 GitHub 上载入最新的 <code>index.js</code> 代码。</p>
<p>PPS：引用了新的 index.js 代码后，因为我的网站是二级目录，而图片的 URL 用的是相对路径，所以生成的 URL 变成了两个 blog。<br > 具体的 URL 类似于： <code>/blog/blog/2022/08/24/helloHexo/helloHexo/2022-08-24-12-44-22-image.png</code><br > 所以我修改了 index.js 里的源码，把 13 行改为 <code>var beginPos = getPosition (link, &#39;/&#39;, 4) + 1;</code> ，把 52 行改为 <code>return elem != &#39;&#39; &amp;&amp; elem != &#39;.&#39; &amp;&amp; elem != &#39;blog&#39;;</code> ，去掉了重复的 blog。这样虽然暂时解决了图片 URL 的问题，但是不利于迁移。</p>
</blockquote>
</li>
</ul>
<h2 id="参考链接"><a href="# 参考链接" class="headerlink" title="参考链接"></a > 参考链接 </h2><p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/"> 文档 | Hexo</a></p>
<p><a target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/docs/">Hexo Fluid 用户手册 </a></p>
<p><a target="_blank" rel="noopener" href="https://snyk.io/advisor/npm-package/hexo-auto-spacing">hexo-auto-spacing - npm Package Health Analysis</a></p>
<p><a target="_blank" rel="noopener" href="https://www.npmjs.com/package/pangu/v/4.0.1">npmjs - pangu</a></p>
<p><a target="_blank" rel="noopener" href="https://github.com/xcodebuild/hexo-asset-image">GitHub - xcodebuild&#x2F;hexo-asset-image</a></p>
<p><a target="_blank" rel="noopener" href="https://github.com/xcodebuild/hexo-asset-image/issues/47">hexo-asset-image 生成图片 URL 的问题 </a></p>
<hr>
<p > 写在最后：最近和同事在讨论个人博客搭建的相关问题，因此找了找目前的各种实现手段。本来打算用 GitHub 搭建，但 GitHub 时常抽风，所以便考虑将个人博客部署在 Gitee 上，作为个人的知识点、问题点的总结（没准也有随笔、小短文啥的）。本文作为博客的第一篇文章，算是给以后的博客的风格做一个参考，写在最后部分应该都会有，包括但不限于博客内容总结、博客记录的诱因、博客记录的目的、个人碎碎念等。</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/blog/categories/%E5%BA%94%E7%94%A8/" class="category-chain-item">应用</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/blog/tags/git/">#git</a>
      
        <a href="/blog/tags/hexo/">#hexo</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>【应用 | Hexo】Gitee Page + Hexo 部署个人博客</div>
      <div>https://sayuw.gitee.io/blog/2022/08/24/helloHexo/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>_SayUw</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年8月24日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/blog/2022/09/05/jsThis/" title="【知识点 | JS】This 指向、箭头函数">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">【知识点 | JS】This 指向、箭头函数</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
      world.execute(me);
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/blog/js/events.js" ></script>
<script  src="/blog/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/blog/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/blog/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/blog/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
